package com.bwie.bwedu.presenter.impl;

import com.bwie.bwedu.activity.TrackInfoActivity;
import com.bwie.bwedu.bean.InfoStudent;
import com.bwie.bwedu.bean.Student;
import com.bwie.bwedu.model.TrackInfoModel;
import com.bwie.bwedu.model.impl.TrackInfoModelImpl;
import com.bwie.bwedu.presenter.TrackInfoPresenter;
import com.bwie.bwedu.utils.ASimpleCacheUtils;
import com.bwie.bwedu.utils.LogUtils;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/7/23.
 */
public class TrackInfoPresenterImpl implements TrackInfoPresenter{

    private TrackInfoActivity activity;
    private final TrackInfoModelImpl model;

    public TrackInfoPresenterImpl(TrackInfoActivity activity) {
        this.activity = activity;
        model = new TrackInfoModelImpl();

    }

    @Override
    public void trackinfo(String id) {
      model.track(id, new TrackInfoModel.TrackinfoListener() {
          @Override
          public void onTrackinfoSuccess(InfoStudent list) {
              if(list.list!=null) {
                  activity.onSuccess(list.list);
              }else {
                  activity.onFail("暂无详细信息");
              }
          }
          @Override
          public void onTrackinfoFail(String fail) {
            activity.onFail(fail);
          }
      });
    }
}
